 <!DOCTYPE html>
 <html>

  <head >

  <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>MIUB</title>

	  	

	  <!--   <script type="text/javascript" src="http://http://jquery.bassistance.de/validate/lib/jquery.metadata.js"></script>-->
    <style type="text/css" title="currentStyle">
			@import "DataTables-1.8.2/media/css/demo_page.css";
			@import "DataTables-1.8.2/media/css/demo_table_jui.css";
			@import "DataTables-1.8.2/examples/examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css";
			@import "DataTables-1.8.2/extras/TableTools/media/css/TableTools.css";
			@import "DataTables-1.8.2/extras/TableTools/media/css/TableTools_JUI.css";
			@IMPORT "jquery-ui-1.8.16.custom/themes/base/jquery.ui.datepicker.css";
		</style>
		
      <style type="text/css">
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
          #count { color:red; }

      </style>

      <script src="http://code.jquery.com/jquery-1.7.1.js"></script>
      <script type="text/javascript" language="javascript" src="DataTables-1.8.2/media/js/jquery.js"></script>

		<script type="text/javascript" language="javascript" src="DataTables-1.8.2/media/js/jquery.dataTables.js"></script>
		<script type="text/javascript" charset="utf-8" src="DataTables-1.8.2/extras/TableTools/media/js/ZeroClipboard.js"></script>
		<script type="text/javascript" charset="utf-8" src="DataTables-1.8.2/extras/TableTools/media/js/TableTools.js"></script> 
	   <script type="text/javascript" charset="utf-8" src="DataTables-1.8.2/extras/TableTools/media/js/TableTools.min.js"></script>
   <!-- <script src="../miub/jquery-ui-1.8.16.custom/js/modernizr-2.0.6.js"></script>-->
<!--[if lt IE 9]>

	 <script src="html5.js">
	 $(document).ready(function(){
	 
	  alert("hallo");
	  
	  });
	  </script>
	  
 <![endif]-->
	

 
<?php
// Session starten
//require_once 'config/db_login_constants.php';
require_once 'login/session.php';
//require_once 'config/login_db.php';
require_once 'login/login.php';
session_start();

if(isset($_POST['submit']) AND $_POST['submit']=='Anmelden' and $_POST['email']!="" and $_POST['userpass']!="" or $_SESSION['berechtiger_user']==1){
	 
	 
	if($_SESSION['berechtiger_user']==null){
		
	$mylogin = new login(session_id());
	$_SESSION['berechtiger_user']=1;
	$_SESSION['name']=$mylogin->getName();
	$_SESSION['vorname']=$mylogin->getVorname();
	$_SESSION['frei']=$mylogin->getFrei();

	}
if(!isset($_SESSION['name'])and !isset($_SESSION['vorname'] )){
	$_SESSION['berechtiger_user']=0;	
	echo '

	
    	<div id="from" align="center" >
    	<br />
    	
    	falsche Login-Daten!!!!
    <a href="index.php">anmelden</a>
    </div>
                             
                        
                        ';}else{
                        if($_SESSION['frei']==0){
                        	$_SESSION['berechtiger_user']=0;
                        
                        echo'
                        <div id="from" align="center" >
    	<br />
                        Ihr Account ist immer noch nicht freigeschaltet!!
                          <a href="index.php">Startseite</a>
    </div>
                        ';
                        
                        }else{
                        
		echo '

	
    	<div id="from" align="center" >
    	<br />
    	Hallo '.$_SESSION['name'].' '.$_SESSION['vorname'].'<br />
    	Sie sind eingeloggt!
    <a href="login/logout.php?id='.session_id().'">Ausloggen</a>
    <br>
    <br>
     <a href="user/user_passwort_change.php">Passwort &auml;ndern</a>
    <br>
    </div>
                             
                        
                        ';
		//header('Location:http://localhost/miub/index.php');
                        }
                        }
	
} else echo '
 

                                        
                                
        <div id="from" align="center">
        <br />
         <form  name="login" method="post"  action="" >
                                         
          E-Mail:
          <input type="text"  name="email"   />
          Passwort:
          <input type="password"  name="userpass"   />
          <input  type="submit" name="submit" value="Anmelden"/>&nbsp;&nbsp;&nbsp;
          <a href="user/user_registrieren.php">  registrieren</a>
          <a href="user/user_passwort_vergessen.php">  Passwort vergessen</a>
          </form>
          </div>
   
                       
                        ';?>

